#include "shortcutsetting.h"

#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>

CShortcutSetting::CShortcutSetting(QWidget *parent)
    :QDialog(parent)
    ,m_screenshotShortCut(this)
{
    Init();
}

void CShortcutSetting::Init()
{
    setAttribute(Qt::WA_QuitOnClose, false);
    QVBoxLayout* pMainLayout = new QVBoxLayout(this);
    pMainLayout->setObjectName("pMainLayout");

    QHBoxLayout* pScreenshotLayout = new QHBoxLayout(this);
    pScreenshotLayout->setObjectName("pScreenshotLayout");
    pScreenshotLayout->addWidget(new QLabel(tr("截屏"), this));
    pScreenshotLayout->addWidget(&m_screenshotShortCut);
    QPushButton *screenshotReset = new QPushButton("重置", this);
    screenshotReset->setObjectName("screenshotReset");
    pScreenshotLayout->addWidget(screenshotReset);
    connect(screenshotReset, &QPushButton::clicked, &m_screenshotShortCut, &QKeySequenceEdit::clear);

    pMainLayout->addLayout(pScreenshotLayout);
    setLayout(pMainLayout);
}
